#pragma once

class Dialog;

class DialogHandler : public Singleton<DialogHandler>
{
	Mutex m_dlgLock;
	std::list<Dialog*> m_dialogs;
	void SetTop(Dialog* pDialog);
public:
	
	void Render();
	void AddDialog(Dialog* pDialg);
	bool MouseActivity(bool left, Vertex2F pos, bool up);
	void OnMouseMove(ui32 x, ui32 y, bool leftDown, bool rightDown);
	void BringToFront(Dialog* pDialog) { SetTop(pDialog); }
};

#define sDialog (*DialogHandler::GetInstance())